{% load i18n %}
<div class="reldatetime">
    {% for group_name, group_choices, group-index in widget.subwidgets.0.optgroups %}
        {% for selopt in group_choices %}
            <div class="radio">
                <label>
                    <input type="radio" name="{{ widget.subwidgets.0.name }}" value="{{ selopt.value }}"
                            {% include "django/forms/widgets/attrs.html" with widget=selopt %} />
                    {{ selopt.label }}
                </label>
                {% if selopt.value == "absolute" %}
                    {% include widget.subwidgets.1.template_name with widget=widget.subwidgets.1 %}
                {% elif selopt.value == "relative_minutes" %}
                    {% include widget.subwidgets.5.template_name with widget=widget.subwidgets.5 %}
                    {% trans "minutes before" %}
                    {% include widget.subwidgets.3.template_name with widget=widget.subwidgets.3 %}
                {% elif selopt.value == "relative" %}
                    {% include widget.subwidgets.2.template_name with widget=widget.subwidgets.2 %}
                    {% trans "days before" %}
                    {% include widget.subwidgets.3.template_name with widget=widget.subwidgets.3 %}
                    {% trans "at" %}
                    {% include widget.subwidgets.4.template_name with widget=widget.subwidgets.4 %}
                {% endif %}
            </div>
        {% endfor %}
    {% endfor %}
</div>
